﻿<Application 
    x:Class="MyWP7Brand_VB.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <!--Application Resources-->
    <Application.Resources>
        <SolidColorBrush x:Key="ForegroundBrush" Color="White"/>
        <SolidColorBrush x:Key="BackgroundBrush" Color="Black"/>
        <Style x:Key="ButtonRefreshStyle" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource ForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Path_refresh">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ForegroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Path_refresh">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentControl x:Name="ContentContainer" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Canvas Width="64" Height="64">
                                    <Path x:Name="ButtonBackground" Width="64" Height="64" Stretch="Fill" Fill="{TemplateBinding Background}" Data="M27.723312,1.2895428E-07 L27.723312,1.2895428E-07 C28.964682,1.2895428E-07 30.221853,0.084004663 31.463224,0.25334385 C46.631153,2.2865932 57.309849,16.288639 55.276558,31.458746 C53.427246,45.182106 41.621872,55.529583 27.810003,55.529583 C26.569931,55.529583 25.307362,55.446968 24.06599,55.277641 C8.8939629,53.235191 -1.7913108,39.234383 0.24998789,24.066977 C2.091347,10.347519 13.903242,1.2895428E-07 27.723312,1.2895428E-07 z" UseLayoutRounding="False"/>
                                    <Path x:Name="Path_refresh" Width="29.41" Height="36.214" Canvas.Left="17.224" Canvas.Top="13.887" Stretch="Fill" Fill="{TemplateBinding Foreground}" Data="M17.103001,8.2569599 C18.9032,8.6062002 20.533899,9.4460402 21.8435,10.6591 L14.6841,11.0229 L18.466999,14.7782 L29.2668,14.537 L29.4095,3.7406001 L25.622601,0 L25.3358,6.7012901 C23.332899,4.8736601 20.8486,3.6073 18.103001,3.0766599 C10.0183,1.50903 1.84949,6.2987099 0,15.8446 L5.7778301,15.9099 C6.79004,10.6791 11.8705,7.24646 17.103001,8.2569599 z M12.136512,28.135502 C10.25881,27.774202 8.5733709,26.869102 7.2399998,25.570702 L14.811314,25.186802 L11.024212,21.435499 L0.22583617,21.671499 L0.085821502,32.471905 L3.8754978,36.213703 L4.144908,29.891102 C6.1077991,31.608202 8.4973202,32.809204 11.133512,33.319702 C19.227816,34.883305 27.624619,29.732403 29.408821,20.539801 L23.473516,20.4797 C22.457417,25.715902 17.374315,29.150002 12.136512,28.135502 z"/>
                                    <Path x:Name="Path_circle" Width="64" Height="64" Stretch="Fill" Fill="{StaticResource ForegroundBrush}" Data="F1 M 31.8906,0C 16.105,0 2.37561,11.6708 0.215332,27.7327C -2.14087,45.2383 10.1523,61.3415 27.6688,63.701C 29.1183,63.8943 30.5557,63.989 31.9773,63.989C 47.7534,63.989 61.4802,52.3209 63.6444,36.2509C 65.9954,18.744 53.7061,2.63812 36.1936,0.287964C 34.7455,0.09198 33.3081,0 31.8906,0 Z M 31.8906,4.23376L 31.8906,4.23376C 33.1321,4.23376 34.3894,4.31775 35.6309,4.48706C 50.8004,6.51996 61.4802,20.5196 59.4467,35.6871C 57.5972,49.4081 45.7906,59.7538 31.9773,59.7538C 30.7371,59.7538 29.4744,59.6712 28.2329,59.5019C 13.0593,57.4598 2.37292,43.4614 4.41443,28.2966C 6.25598,14.5795 18.0691,4.23376 31.8906,4.23376 Z "/>
                                </Canvas>
                            </ContentControl>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>



        <Style x:Key="ButtonStyle1" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
            <Setter Property="Padding" Value="10,3,10,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Black"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Yellow"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0">
                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>